<?php

class CategoriasView extends Categorias{
	
	public function listar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){      	
			echo '<tr>';
				echo '<td width="10%" align="center"><img src="../images/banco/',$arr[$i]['imagem0'],'"/></td>';
				echo '<td width="50%">',$arr[$i]['nome'],'</td>';
				echo '<td width="20%" align="center" onclick="javascript:editar(',$arr[$i]['idcategorias'],',\'categorias\');" class="tabelaB"><img src="images/app-edit-icon.png" width="20" align="absmiddle" /> Editar</td>';
				echo '<td width="20%" id="editar" align="center" onclick="javascript:excluir(',$arr[$i]['idcategorias'],',\'Categorias\');" class="tabelaB"><img src="images/app-delete-icon.png" width="20" align="absmiddle" /> Excluir</td>';
			echo '</tr>';
	    }
	}
	public function select($arr){
		$total = count($arr);
		echo '<option value = "0">Selecione</option>';
		for($i = 0;$i < $total;$i++){
			echo '<option value="',$arr[$i]['idcategorias'],'">',$arr[$i]['nome'],'</option>';
	    }
	}
	public function visualizar($arr){
		$total = count($arr);		
		for($i = 0;$i < $total;$i++){
			echo '<li><a href="estilo.php?id=',$arr[$i]['idcategorias'],'"><img src="images/banco/',$arr[$i]['imagem1'],'" align="center" /></a></li>';
		}		
	}
}
?>